package com.robot.botrunning.controller.botRunning;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.robot.botrunning.service.botRunning.botRunningService;
@RestController
@RequestMapping("/botRunning/")
public class botRunningController {
    @Autowired
    botRunningService botRunningService;
    @PostMapping("addBot/")
    String addBot(@RequestParam MultiValueMap<String,String> map){
        return botRunningService.addBot(Integer.parseInt(map.getFirst("id")), Integer.parseInt(map.getFirst("uid")),map.getFirst("botCode"),map.getFirst("map"),
                Integer.parseInt(map.getFirst("myX")),Integer.parseInt(map.getFirst("myY")),Integer.parseInt(map.getFirst("oppoX")),
                Integer.parseInt(map.getFirst("oppoY")), map.getFirst("steps"),map.getFirst("pos"),map.getFirst("lang"));
    }
}
